package com.mandao.formservice;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.InetAddress;

/**
 * @author 蜗牛
 * springcloud web表单提交
 */
@SpringBootApplication
public class FormServiceApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(FormServiceApplication.class, args);
        String applicationName = run.getApplicationName();
        ServerProperties bean = run.getBean(ServerProperties.class);
        InetAddress address = bean.getAddress();
        Integer port = bean.getPort();
        String contextPath = bean.getServlet().getContextPath();
        System.out.println("------------> run at: " +address+"\t"+contextPath+"\t"+port+"\t"+applicationName);
    }

}
